import random


class Sprite:
    def __init__(self, name, blood, attack):
        self.name = name
        self.blood = blood
        self.attack = attack

 # 每次攻击扣除对方的血量是攻击力加减N的随机值
    def attack(self, name):
        n = random.randint(0, self.attack)
        hurt = random.randrange(self.attack - n, self.attack + n)
        print(hurt)

    def get_blood(self):
        return self.blood

    def dead(self):
        return self.blood <= 0

class Monster(Sprite):
    pass


class Hero(Sprite):
    pass
